package cn.wuyi.common.rest;


import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @类功能说明:  调用rest接口返回的对象封装 
 * @公司名称     :中企动力
 * @作者                ：ce 
 * @创建时间      ：2015年8月28日 上午10:54:13  
 * @版本                ：V1.0
 * @param <T>
 */
public class ResponseResult<T> implements Serializable {
	
	/**
	 * @Fields serialVersionUID | long
	 */
	private static final long serialVersionUID = -2184810210942217531L;

	public static int EXCEPTION_CODE = -1;
	
	public static String EXCEPTION_DESC = "REST_EXCEPTION";
	
	private T body;
	private int code;
	private String resultDesc;
	private String exception;
	
	private Map<String,Object> additionalInfo = new HashMap<String,Object>();

	public T getBody() {
		return body;
	}

	public void setBody(T body) {
		this.body = body;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getResultDesc() {
		return resultDesc;
	}

	public void setResultDesc(String resultDesc) {
		this.resultDesc = resultDesc;
	}

	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}

	public Object getAdditionalParameterValue(String key) {
		return this.additionalInfo.get(key);
	}

	public void setAdditionalParameter(String key,Object value) {
		this.additionalInfo.put(key, value);
	}

	@Override
	public String toString() {
		return "ResponseResult [body=" + body + ", code=" + code
				+ ", resultDesc=" + resultDesc + ", exception=" + exception
				+ ", additionalInfo=" + additionalInfo + "]";
	}
	
	
	
	
}
